package com.my.study.springframework.bean.factory.support;

import com.my.study.springframework.bean.BeansException;
import com.my.study.springframework.bean.factory.config.BeanDefinition;

import java.lang.reflect.Constructor;

/**
 * 实例化策略接口
 *
 * @author: yidujun
 * @create: 2021/06/18 11:10
 */
public interface InstantiationStrategy {

    /**
     * 通过指定构造函数创建对象
     *
     * @param beanDefinition
     * @param beanName
     * @param ctor
     * @param args
     * @return
     * @throws BeansException
     */
    Object instantiate(BeanDefinition beanDefinition, String beanName, Constructor<?> ctor, Object[] args) throws BeansException;
}
